<template>
    <rx-layout style="padding: 10px">
        <div slot="center" style>
            <rx-fit :isheader="isheader">
                <rx-grid
                    ref="table"
                    :allowRowSelect="true"
                    :multiSelect="true"
                    :columns="columns"
                    :defaultPageSize="10"
                    url="/api-system/system/core/sysGitManage/query"
                    :queryParam="queryParam"
                    data-field="result.data"
                    :pageSizeOptions="['10','30','40']"
                    id-field="id"
                    @selectChange="onSelectChange"
                >
                    <span slot="action" slot-scope="{ text, record }" class="actionIcons">
                         <span v-if="editEnable && showBtn(false)" @click="edit(record)">{{$ti18('rxList.editBtn','编辑')}}</span>
                         <span v-if="removeEnable && showBtn(false)" @click="delByIds([record.id])">{{$ti18('rxList.delBtn','删除')}}</span>
                   </span>
                </rx-grid>
            </rx-fit>
        </div>
    </rx-layout>
</template>

<script>
import SysGitManageEdit from './SysGitManageEdit.vue'
import {BaseList, RxFit} from '@lowcode/jpaas-common-lib';
import SysGitManageApi from "@/api/system/core/sysGitManage";

export default {
    name: 'SysGitManageList',
    mixins: [BaseList],
    components: {
        RxFit
    },
    data() {
        return {
            columns: [
                {
                    title: this.$ti18('rxList.index','序号'),
                    type: 'indexColumn',
                    width: 40,
                    dataIndex: 'serial',
                    scopedSlots: {customRender: 'serial'}
                },
                {title: 'URL', dataIndex: 'url', width: 200},
                {title: '创建人', dataIndex: 'createByName', width: 100},
                {title: '创建时间', dataIndex: 'createTime', width: 100},
                {title: this.$ti18('rxList.action','操作'), width: 100, dataIndex: 'action', scopedSlots: {customRender: 'action'}}
            ],
            fitSearch:false,
            component: SysGitManageEdit,
            comment: "Git连接器",
            widthHeight: ['800px', '550px']
        }
    },
    methods: {
        delById(ids) {
            return SysGitManageApi.del({ids: ids.join(',')});
        }
    }
}
</script>
<style scoped>
.table-operator {
    padding: 4px;
}

.table-operator button {
    margin: 2px;
}
</style>

